package model;

import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RectangularShape;

/**
 * A Class to maintain all constants used throughout various packages of the CTF2009 application.
 * @author N. Bhatia, A. Butt, N. Evans, C. Levesque, P. OKeefe
 *
 */
public abstract class GameConstants {
	public static boolean TEST_MODE = true;
	public static double CLOCK_MULTIPLIER = 1.0;
	public static final int NUM_PLAYERS_PER_SIDE = 8;
	public static final String STEAL_VERSION = "6.0";
	public static int SERVER_PORT = 23452;
	public static int MAX_CONNECTIONS = 2;

	// player movement rules
	public static final double MINIMUM_PLAYER_SPEED = 0.0; // in m/s
	public static final double MAXIMUM_PLAYER_SPEED = 5.0; // in m/s
	public static final double MAXIMUM_FLAG_CARRIER_SPEED = 4.0; // in m/s
	public static final double MINIMUM_PLAYER_ACCELERATION = -5.0; // in m/s^2
	public static final double MAXIMUM_PLAYER_ACCELERATION = 2.0; // in m/s^2
	public static final double MINIMUM_PLAYER_ANGULAR_VELOCITY = -90.0; // in
	// degrees/s
	public static final double MAXIMUM_PLAYER_ANGULAR_VELOCITY = 90.0; // in
	// degrees/s	
	
	//Game End Reasons
	public static final int GAME_END_FLAG_CAP = 0;
	public static final int GAME_END_TEAM_CAP = 1;
	
	//Player visibility rules
	public static final double PLAYER_VIEW_DIST = 75;
	public static final double PLAYER_FIELD_OF_VIEW = 120; 
	public static final double FLAG_RADIUS = 0;

	// field definition
	public static final int FIELD_WIDTH = 500;
	public static final int FIELD_HEIGHT = 250;
	public static final int NUM_TREES_PER_SIDE = 10;
	public static final RectangularShape LEFT_TEAM_JAIL = new Rectangle2D.Double(
			0.0, 0.0, 25.0, 25.0);
	public static final RectangularShape RIGHT_TEAM_JAIL = new Rectangle2D.Double(
			475.0, 0.0, 25.0, 25.0);
	public static double MAXIMUM_EXCLUSION_ZONE_RADIUS = 25.0;
	
	//update periods
	public static final int VIEW_UPDATE_PERIOD = 40;
	public static final int MODEL_UPDATE_PERIOD = 5;

	// graphics settings
	public static final double PLAYER_RADIUS = .2;
	public static final double TREE_RADIUS = 1;
	
	//Legal flag placements
	public static final int ILLEGAL_FLAG_DIST_TO_PLAYER = 25;
	public static final int ILLEGAL_FLAG_DIST_TO_OBJECT = 1;
	
	//TCTF constants
	public static final int MAX_TIME_IN_TCTF_MILLIS = 7000;
	public static final int MAX_TIME_AS_ESCAPEE_MILLIS = 60000;
	
	//player start positions
	public static final Point2D[] LEFT_TEAM_START_POSITIONS = {
		new Point2D.Double(200, 195),
		new Point2D.Double(200, 175),
		new Point2D.Double(200, 155),
		new Point2D.Double(200, 135),
		new Point2D.Double(200, 115),
		new Point2D.Double(200, 95),
		new Point2D.Double(200, 75),
		new Point2D.Double(200, 55)
	};
	public static final Point2D[] RIGHT_TEAM_START_POSITIONS = {
		new Point2D.Double(300, 195),
		new Point2D.Double(300, 175),
		new Point2D.Double(300, 155),
		new Point2D.Double(300, 135),
		new Point2D.Double(300, 115),
		new Point2D.Double(300, 95),
		new Point2D.Double(300, 75),
		new Point2D.Double(300, 55)
	};
	
	
	//tree positions
	public static Point2D[] TREE_POSITIONS = {
		new Point2D.Double(125, 215),
		new Point2D.Double(125, 195),
		new Point2D.Double(125, 175),
		new Point2D.Double(125, 155),
		new Point2D.Double(125, 135),
		new Point2D.Double(125, 115),
		new Point2D.Double(125, 95),
		new Point2D.Double(125, 75),
		new Point2D.Double(125, 55),
		new Point2D.Double(125, 35),
		new Point2D.Double(375, 215),
		new Point2D.Double(375, 195),
		new Point2D.Double(375, 175),
		new Point2D.Double(375, 155),
		new Point2D.Double(375, 135),
		new Point2D.Double(375, 115),
		new Point2D.Double(375, 95),
		new Point2D.Double(375, 75),
		new Point2D.Double(375, 55),
		new Point2D.Double(375, 35),

	};


}
